<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>UCARPP: includes/swap.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>


</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">UCARPP
   &#160;<span id="projectnumber">1</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('swap_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">includes/swap.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="swap_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="preprocessor">#ifndef SWAP_H_</span>
<a name="l00002"></a>00002 <span class="preprocessor"></span><span class="preprocessor">#define SWAP_H_</span>
<a name="l00003"></a>00003 <span class="preprocessor"></span>
<a name="l00004"></a>00004 <span class="preprocessor">#include &lt;stdbool.h&gt;</span>
<a name="l00005"></a>00005 <span class="preprocessor">#include &quot;<a class="code" href="vehicleState_8h.html">vehicleState.h</a>&quot;</span>
<a name="l00006"></a>00006 <span class="preprocessor">#include &quot;<a class="code" href="operations_8h.html">operations.h</a>&quot;</span>
<a name="l00007"></a>00007 <span class="preprocessor">#include &quot;<a class="code" href="tabooList_8h.html">tabooList.h</a>&quot;</span>
<a name="l00008"></a>00008 <span class="preprocessor">#include &quot;<a class="code" href="solution_8h.html">solution.h</a>&quot;</span>
<a name="l00009"></a>00009 <span class="preprocessor">#include &quot;<a class="code" href="los_8h.html">los.h</a>&quot;</span>
<a name="l00010"></a>00010 <span class="preprocessor">#include &quot;<a class="code" href="graph_8h.html">graph.h</a>&quot;</span>
<a name="l00011"></a>00011 
<a name="l00013"></a><a class="code" href="swap_8h.html#a852f1d05a3db63fa78289bcd18425c1d">00013</a> <span class="preprocessor">#define SWAP_NOTQ_OK 0</span>
<a name="l00014"></a>00014 <span class="preprocessor"></span>
<a name="l00015"></a><a class="code" href="swap_8h.html#a4eb7aea6401ed2bca9d7927cce60a21e">00015</a> <span class="preprocessor">#define SWAP_ONLYEDGE1 1</span>
<a name="l00016"></a>00016 <span class="preprocessor"></span>
<a name="l00017"></a><a class="code" href="swap_8h.html#a4f960f22c330c04180b14df7d1fbd370">00017</a> <span class="preprocessor">#define SWAP_ONLYEDGE2 2</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span>
<a name="l00019"></a><a class="code" href="swap_8h.html#a33573da89808bfd9008875829ab5eaa3">00019</a> <span class="preprocessor">#define SWAP_BOTHEDGES 3</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span>
<a name="l00022"></a><a class="code" href="swap_8h.html#a79f71d3904b4586b6ff2bdec43e1d6e6">00022</a> <span class="preprocessor">#define SWAP_ADDTENURE 2</span>
<a name="l00023"></a>00023 <span class="preprocessor"></span>
<a name="l00024"></a><a class="code" href="swap_8h.html#a6bd1043d35f7ae4eba54f1d395036414">00024</a> <span class="preprocessor">#define SWAP_REMTENURE 1</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span>
<a name="l00027"></a><a class="code" href="swap_8h.html#aaef62fa04d3b6d4b3c11d852387b5a85">00027</a> <span class="preprocessor">#define SWAP_GENERATIONMODE_0 0</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span>
<a name="l00030"></a><a class="code" href="swap_8h.html#a2361d618de86d00d133f2f1deaa4d1c1">00030</a> <span class="preprocessor">#define SWAP_GENERATIONMODE_1 1</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span>
<a name="l00042"></a>00042 <span class="comment">/* Struttura usata principalmente per prototipi più maneggevoli. */</span>
<a name="l00043"></a><a class="code" href="structSwapBestChoice.html">00043</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structSwapBestChoice.html">SwapBestChoice</a> {
<a name="l00045"></a><a class="code" href="structSwapBestChoice.html#ab4245dec6ab2fcd6c04a3fd6f952f8b5">00045</a>         <a class="code" href="structEdgeID.html">EdgeID</a> <a class="code" href="structSwapBestChoice.html#ab4245dec6ab2fcd6c04a3fd6f952f8b5">bestRemove1</a>;
<a name="l00047"></a><a class="code" href="structSwapBestChoice.html#ada6e3624ee17f47a205925668f9c3feb">00047</a>         <a class="code" href="structEdgeID.html">EdgeID</a> <a class="code" href="structSwapBestChoice.html#ada6e3624ee17f47a205925668f9c3feb">bestRemove2</a>;
<a name="l00048"></a><a class="code" href="structSwapBestChoice.html#a2a8d6341de2479bb7e8c1cc9308eb466">00048</a>         <a class="code" href="structEdgeID.html">EdgeID</a> <a class="code" href="structSwapBestChoice.html#a2a8d6341de2479bb7e8c1cc9308eb466">bestAdd1</a>;
<a name="l00049"></a><a class="code" href="structSwapBestChoice.html#a3dfe90c5749ebdf328a493e3e11b156c">00049</a>         <a class="code" href="structEdgeID.html">EdgeID</a> <a class="code" href="structSwapBestChoice.html#a3dfe90c5749ebdf328a493e3e11b156c">bestAdd2</a>;
<a name="l00050"></a><a class="code" href="structSwapBestChoice.html#a060ebf06872cb357d1fe874ef879d814">00050</a>         <span class="keywordtype">bool</span> <a class="code" href="structSwapBestChoice.html#a060ebf06872cb357d1fe874ef879d814">useAdd1</a>;
<a name="l00051"></a><a class="code" href="structSwapBestChoice.html#ac83d3287c12d414bb4d28a77ffed6d71">00051</a>         <span class="keywordtype">bool</span> <a class="code" href="structSwapBestChoice.html#ac83d3287c12d414bb4d28a77ffed6d71">useAdd2</a>;
<a name="l00053"></a><a class="code" href="structSwapBestChoice.html#a75aacdfc4c438bd6a2807b6501723e42">00053</a>         <span class="keywordtype">int</span> <a class="code" href="structSwapBestChoice.html#a75aacdfc4c438bd6a2807b6501723e42">bestValutation</a>;
<a name="l00054"></a>00054 } <a class="code" href="swap_8h.html#aba2c47ed6ed1a3d668cb8f8f3dbf767d">SwapBestChoice</a>;
<a name="l00055"></a>00055 
<a name="l00057"></a><a class="code" href="swap_8h.html#aa7bd09f50bcf82141869eebd88e6e1ae">00057</a> <span class="keyword">typedef</span> <a class="code" href="structSwapBestChoice.html">SwapBestChoice</a>* <a class="code" href="swap_8h.html#aa7bd09f50bcf82141869eebd88e6e1ae">PswapBestChoice</a>;
<a name="l00058"></a>00058 
<a name="l00066"></a>00066 <a class="code" href="structSwapBestChoice.html">PswapBestChoice</a> <a class="code" href="swap_8h.html#ab2a010784b9ef69f54637be4b6f3d47e">initSwapBestChoice</a>();
<a name="l00067"></a>00067 
<a name="l00094"></a>00094 <span class="keywordtype">void</span> <a class="code" href="swap_8h.html#a56cd353453c90dfe6e0969a5a301e6cf">generateCrossedEdges</a>(<a class="code" href="structEdgeID.html">PedgeID</a> e1, <a class="code" href="structEdgeID.html">PedgeID</a> e2,<a class="code" href="structEdgeID.html">PedgeID</a> s1,<a class="code" href="structEdgeID.html">PedgeID</a> s2,<span class="keywordtype">int</span> generationmode);
<a name="l00095"></a>00095 
<a name="l00105"></a>00105 <span class="keywordtype">void</span> <a class="code" href="swap_8h.html#a309c2fe53dad5a17e42e388ec0d8ffa2">printSwapBestChoice</a>(FILE* f,<a class="code" href="structSwapBestChoice.html">PswapBestChoice</a> obj);
<a name="l00106"></a>00106 
<a name="l00113"></a>00113 <span class="keywordtype">void</span> <a class="code" href="swap_8h.html#a59fbe3e6e2f486f6da2cd77037c74185">freeSwapBestChoice</a>(<a class="code" href="structSwapBestChoice.html">PswapBestChoice</a> obj);
<a name="l00114"></a>00114 
<a name="l00126"></a>00126 <span class="keywordtype">int</span> <a class="code" href="swap_8h.html#ae5d2cd8db1c54c2597b31a06985cba4e">solveSwapNeighbourhood</a>(<a class="code" href="structGraph.html">Pgraph</a> p_graph, <a class="code" href="structVehicleState.html">PvehicleState</a> p_state, <a class="code" href="structGMatrix.html">PGMatrix</a> p_gMat, <span class="keywordtype">int</span> k, <a class="code" href="structTabooList.html">PtabooList</a> p_tabooList, <a class="code" href="tabooExpire_8h.html#a03a425df65af050afbb5cab3c16f4263">TabooExpire</a> now, <a class="code" href="structLOSConfiguration.html">pLOSConfiguration</a> pLOSconfig, <span class="keywordtype">bool</span> notWorseningMoves);
<a name="l00127"></a>00127 
<a name="l00146"></a>00146 <span class="keywordtype">void</span> <a class="code" href="swap_8h.html#af616063de55cc38332cab2757e80dbff">makeSwapMove</a>(<a class="code" href="structGraph.html">Pgraph</a> pg,<a class="code" href="structVehicleState.html">PvehicleState</a> pvs, <a class="code" href="structGMatrix.html">PGMatrix</a> pgm, <span class="keywordtype">int</span> k, <a class="code" href="structTabooList.html">PtabooList</a> ptl, <a class="code" href="tabooExpire_8h.html#a03a425df65af050afbb5cab3c16f4263">TabooExpire</a> now, <a class="code" href="structSwapBestChoice.html">PswapBestChoice</a> pbest, <span class="keywordtype">int</span> addTenure, <span class="keywordtype">int</span> removeTenure);
<a name="l00147"></a>00147 
<a name="l00163"></a>00163 <span class="keywordtype">void</span> <a class="code" href="swap_8h.html#ac2d9107aa0d5294289772e3ccffa9892">updateSwapBestChoice</a>(<a class="code" href="structSwapBestChoice.html">PswapBestChoice</a> pbc, <a class="code" href="structEdgeID.html">PedgeID</a> toadd1, <a class="code" href="structEdgeID.html">PedgeID</a> toadd2,<a class="code" href="structEdgeID.html">PedgeID</a> toremove1,<a class="code" href="structEdgeID.html">PedgeID</a> toremove2, <span class="keywordtype">int</span> jk,<span class="keywordtype">bool</span> gtoadd1,<span class="keywordtype">bool</span> gtoadd2);
<a name="l00164"></a>00164 
<a name="l00192"></a>00192 <span class="keywordtype">int</span> <a class="code" href="swap_8h.html#a6d6e84578c2fe8213ccc2a6132d19c1e">isTQOKSwap</a>(<a class="code" href="structGraph.html">Pgraph</a> graph,<a class="code" href="structGMatrix.html">PGMatrix</a> pgm,<span class="keywordtype">int</span> k,<a class="code" href="structVehicleState.html">PvehicleState</a> state,<a class="code" href="structEdgeID.html">PedgeID</a> toadd1, <a class="code" href="structEdgeID.html">PedgeID</a> toadd2, <a class="code" href="structEdgeID.html">PedgeID</a> toremove1,<span class="keywordtype">int</span> toremove1passed, <a class="code" href="structEdgeID.html">PedgeID</a> toremove2,<span class="keywordtype">int</span> toremove2passed);
<a name="l00193"></a>00193 
<a name="l00194"></a>00194 <span class="preprocessor">#endif </span><span class="comment">/* SWAP_H_ */</span>
</pre></div></div><!-- contents -->
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="swap_8h.html">swap.h</a>      </li>

    <li class="footer">Generated on Wed Sep 4 2013 06:38:56 for UCARPP by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.6.1 </li>
   </ul>
 </div>


</body>
</html>
